package service;

import dao.UserDao;
import essenceClasses.User;
import helper.UserHelper;
import interfaceService.IUserService;

import java.sql.SQLException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: user
 * Date: 01.06.14
 * Time: 11:18
 * To change this template use File | Settings | File Templates.
 */
public class UserService implements IUserService {
    private UserDao userDao = null;

    public UserService() {
        this.userDao = new UserDao();
    }

    @Override
    public List<User> getAllUser() throws SQLException {

        return userDao.getAllUser();  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public User getUser(String login) throws SQLException {
        return userDao.getUser(login);  //To change body of implemented methods use File | Settings | File Templates.
    }


    @Override
    public User addUser(String login, String pass, String fio, int access) throws SQLException {

        return userDao.addUser(login, pass, fio, access);  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public int getAccessUser(String login) throws SQLException {
        return userDao.getAccesUser(login);  //To change body of implemented methods use File | Settings | File Templates.
    }


}
